var  raNum;
$(function(){
      $("#d2").click(function(){
        raNum = Math.random()*360;
        $(this).rotate({
          duration:1000,
          angle:0,
          animateTo:raNum+300,
          callback:function(){
            A() 
          }
        });


      });
});
function A() {
  if(0< raNum && raNum <= 22.5) {
    alert("谢谢参与");
    return;
  }
  else if (22.5 < raNum && raNum<=67.5){
    alert("谢谢参与");
    return;
  }
  else if (67.5 < raNum && raNum<=112.5){
    alert("恭喜您中二等奖")
    return;
  }
  else if (112.5 < raNum && raNum<=157.5){
    alert("谢谢参与")
    return;
  }
  else if(157.5 < raNum && raNum<=202.5){
    alert('恭喜你中四等奖');
    return;
  }
  else if(202.5 < raNum && raNum<=247.5){
    alert('恭喜你中了四等奖');
    return;
  }
  else if(247.5 < raNum && raNum<=292.5){
    alert('谢谢参与');
    return;
  }
  else if(292.5 < raNum && raNum<=337.5){
    alert('恭喜你中了wu等奖');
    return;
  }



}
